package com.qf.service.impl;

import com.qf.dao.repository.RatationRepository;
import com.qf.pojo.dto.Ratation;
import com.qf.pojo.resVo.BaseResult;
import com.qf.service.RatationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RatationServiceImpl  implements RatationService {
    @Autowired
    RatationRepository ratationRepository;

    @Override
    public BaseResult findAll() {
        //根据轮播图状态查询，并且根据imageIndex 排序
        List<Ratation> ratationList = ratationRepository.findByStatusOrderByImageIndex("start");

        return new BaseResult(1,"查询成功",ratationList,null);
    }
}
